How to calculate the average power for AC generator